import 'package:flutter/material.dart';
import '../../pages/set_theme.dart';

import '../../model/my_store.dart';
import '../../model/custome_router.dart';

import '../../pages/login.dart';
import '../../pages/offline_reply.dart';

class DrawerOptList extends StatelessWidget {
  DrawerOptList({
    Key key,
    @required this.cs_id,
    this.setTheme
  }):super(key:key);
  int cs_id;
  dynamic setTheme;
  @override
  Widget build(BuildContext context) {
    return Expanded(
      child: ListView(
        padding: EdgeInsets.all(0),
        children: <Widget>[
          Divider(height: 0),
          ListTile(
            leading: Icon(Icons.cloud_off),
            title: Text('离线回复'),
            onTap: () {
              Navigator.of(context).push(CustomeRouter(
                OfflineReply()
              ));
            }
          ),
          Divider(height: 0),
          ListTile(
            leading: Icon(Icons.send),
            title: Text('消息群发'),
            onTap: () {}
          ),
          Divider(height: 0),
          ListTile(
            leading: Icon(Icons.color_lens),
            title: Text('主题'),
            onTap: () {
              Navigator.of(context).push(CustomeRouter(
                SelectTheme(
                  setTheme: this.setTheme,
                )
              ));
            }
          ),
          Divider(height: 0),
          ListTile(
            leading: Icon(Icons.settings),
            title: Text('设置'),
            onTap: () {}
          ),
          Divider(height: 0),
          ListTile(
            leading: Icon(Icons.exit_to_app),
            title: Text('退出'),
            onTap: () {
              MyStore().delData('LOGININFO');
              Navigator.of(context).pushReplacement(CustomeRouter(
                Login(
                  setTheme: this.setTheme,
                )
              ));
            }
          ),
        ],
      )
    );
  }
}